<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>Document</title>
		<style>
			*{
				padding: 0;
				margin: 0;
			}
			h1{
				font-size: 60px;
			}
			#demo{
				width: 980px;
				height: 300px;
				background-color: skyblue;
			}
		</style>
	</head>
	<body>
		<div id="demo"></div>
		<h1 id="d1">当前设备布局视口宽度为：</h1>
		<h1 id="d2">当前设备视觉视口宽度为：</h1>
		<script type="text/javascript" >
			const d1 = document.getElementById('d1')
			const d2 = document.getElementById('d2')
			d1.innerHTML += document.documentElement.clientWidth
			d2.innerHTML += window.innerWidth

			console.log('该设备的布局视口宽度为：',document.documentElement.clientWidth)
			console.log('该设备的视觉视口宽度为：',window.innerWidth)
		</script>
	</body>
</html>